Skip to content

Conversation

@AgraVator
Copy link
Contributor

No description provided.

@AgraVator AgraVator requested a review from ejona86 September 30, 2025 16:48
@ejona86
Copy link
Member

ejona86 commented Sep 30, 2025

The issue was that it didn't propagate to metrics... but you don't test metrics. I'd expect changes to

private static final class ClientTracer extends ClientStreamTracer {

This can be considered a good step, as it is now propagated to the application. Basically, when you say "propagation" you need to say what you are propagating to. But this would only be one part of what had been discussed earlier. (And this can go in before the rest of the metrics is working.)

@ejona86 ejona86 added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Sep 30, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Sep 30, 2025
Context serverCallContext = Context.current();
serverCallContext = serverCallContext.with(span);
Baggage baggage = BAGGAGE_KEY.get(io.grpc.Context.current());
if (baggage != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it was never set...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could it be never set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not present in the header...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, so we are getting it from the grpc context which uses

    /**
     * Get the value from the specified context for this key.
     */
    @SuppressWarnings("unchecked")
    public T get(Context context) {
      T value = (T) PersistentHashArrayMappedTrie.get(context.keyValueEntries, this);
      return value == null ? defaultValue : value;
    }

and can return null

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is added unconditionally to the context earlier, so it shouldn't be missing. If it is missing, that seems like a bug, and something we'd want to know about. Seems we should do something, other than ignore it.

Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging, fix the commit title to start with "opentelemetry:" and include any relevant details in the description. For example, there is an internal bug for this, so that should be included in the commit message.

@AgraVator AgraVator merged commit 7cb8b68 into grpc:master Nov 7, 2025
16 of 17 checks passed
AgraVator added a commit to AgraVator/grpc-java that referenced this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants